projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ec1a40
)
mtd, spi: Check if flash pointer is used
author
Heiko Schocher
<
[email protected]
>
Mon, 27 Apr 2015 05:42:07 +0000
(07:42 +0200)
committer
Jagan Teki
<
[email protected]
>
Mon, 29 Jun 2015 19:10:11 +0000
(
00:40
+0530)
If flash pointer is used free it, before probing a new
flash and storing it in flash.
Signed-off-by: Heiko Schocher <
[email protected]
>
Tested-by: Jagannadh Teki <
[email protected]
>
Reviewed-by: Jagannadh Teki <
[email protected]
>
common/cmd_sf.c
patch
|
blob
|
history
diff --git
a/common/cmd_sf.c
b/common/cmd_sf.c
index 9bced29cf97a45dc6a8c78778b205eae69796a03..aef8c2a5ea8498073d520dfbc127c0c9acc32e19 100644
(file)
--- a/
common/cmd_sf.c
+++ b/
common/cmd_sf.c
@@
-135,7
+135,12
@@
static int do_spi_flash_probe(int argc, char * const argv[])
flash = dev_get_uclass_priv(new);
#else
+ if (flash)
+ spi_flash_free(flash);
+
new = spi_flash_probe(bus, cs, speed, mode);
+ flash = new;
+
if (!new) {
printf("Failed to initialize SPI flash at %u:%u\n", bus, cs);
return 1;